package com.kws.merchant.controller;


import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.kws.merchant.domain.OperationTicketFile;
import com.kws.merchant.domain.po.TickFilePo;
import com.kws.merchant.service.OperationTicketFileService;
import com.kws.merchant.util.FileUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;
import com.kws.common.core.domain.R;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

/**
 * 运维-两票管理模板(OperationTicketFile)表控制层
 *
 * @author yxy
 * @since 2024-10-28 10:06:48
 */
@RestController
@Api(tags = "运维-两票管理模板(OperationTicketFile)")
@RequestMapping("operationTicketFile")
public class OperationTicketFileController {
    /**
     * 服务对象
     */
    @Resource
    private OperationTicketFileService operationTicketFileService;
 
   /* @PostMapping("/page")
    @ApiOperation(value = "分页查询列表")
    public R<Page<OperationTicketFile>> pageList(@RequestBody OperationTicketFile operationTicketFile){
        return R.ok(operationTicketFileService);
    }*/


    @GetMapping("/list/{type}")
    @ApiOperation(value = "两票模板列表")
    public R<List<OperationTicketFile>> list(@PathVariable Integer type) {
        return R.ok(operationTicketFileService.listByType(type));
    }

    @PostMapping("/upload")
    @ApiOperation(value = "两票模板上传")
    public R upload(@ModelAttribute TickFilePo tickFilePo) {
        return R.ok(operationTicketFileService.upload(tickFilePo));
    }

    /*@PostMapping("/download")
    @ApiOperation(value = "两票模板下传")
    public R download(String filePath, HttpServletResponse response) {
        return R.ok(operationTicketFileService.download(filePath,response));
    }*/
}
